package com.changanw.data_scop.controller;

import com.changanw.data_scop.annotation.DataScope;
import com.changanw.data_scop.entity.Dept;
import com.changanw.data_scop.service.IDeptService;
import org.apache.catalina.LifecycleState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 部门表 前端控制器
 * </p>
 *
 * @author changanw
 * @since 2023-04-03
 */
@RestController
@RequestMapping("/dept")
public class DeptController {
    @Autowired
    IDeptService deptService;
    @GetMapping("/")
    @DataScope(deptAlias = "d")
    public List<Dept> getAlldept(Dept dept){
        return deptService.getAll(dept);
    }
}
